build: clean up .pc generation
authorJan Tojnar <jtojnar@gmail.com>
Wed, 29 Apr 2020 05:42:38 +0000 (07:42 +0200)
committerJan Tojnar <jtojnar@gmail.com>
Wed, 29 Apr 2020 05:42:53 +0000 (07:42 +0200)
Path concatenation is much nicer than the unwieldy format method.
Since paths returned by get_option are relative to prefix, they will be joined as before.

As a bonus, this fixes weird platforms like NixOS that actually pass absolute includedir under a different prefix.

meson.build

index 12388f743a8b0b325ed8e5478d634c27f607e17c..fcd3fe20521ea840de418f8707b4cf9bc9ca5457 100644 (file)
@@ -720,8 +720,8 @@ pkgconf = configuration_data()
 
 pkgconf.set('prefix', get_option('prefix'))
 pkgconf.set('exec_prefix', '${prefix}')
-pkgconf.set('libdir', '${prefix}/@0@'.format(get_option('libdir')))
-pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir')))
+pkgconf.set('libdir', '${prefix}' / get_option('libdir'))
+pkgconf.set('includedir', '${prefix}' / get_option('includedir'))
 pkgconf.set('GTK_API_VERSION', gtk_api_version)
 pkgconf.set('VERSION', meson.project_version())
 pkgconf.set('GTK_BINARY_VERSION', gtk_binary_version)